/**
 * Created by 小虎Oni on 2016/9/27.
 */
var React = require('react');
var ReactDOM = require('react-dom');
var RouteInstance = require('react-router');
var WebApiUtils = require('./utils/WebApiUtils');
var OniActionCreators = require('./utils/OniActionCreators');

var Router = RouteInstance.Router,
    Route = RouteInstance.Route,
    IndexRoute = RouteInstance.IndexRoute,
    hashHistory = RouteInstance.hashHistory;

var Home = require('./webpage/Home');
var Index = require('./webpage/Index');
var Login = require('./webpage/Login');
var oniState = (
    <Router history={hashHistory}>
        <Route path="/" component={Index} >
            <Route path="/home" component={Home} />
            <Route path="/login" component={Login} />
            <IndexRoute component={Home} />
        </Route>
    </Router>
);
//                                                                配置表
//ZBACTION.receiveAction('FIRST_TEST_ACTION');//---> WebApiUtils -->Test.json-->success -->抛事件---->......---->View
WebApiUtils.xHttpPost('/Test.json',{}).then(function (data) {
    console.log("Http success");
    //
    OniActionCreators.receiveAction('FIRST_TEST_ACTION',data.title);
});
ReactDOM.render(oniState, document.getElementById('react-application'));

